package com.vicente.managerdemo.mapper;

import com.vicente.managerdemo.entity.Menu;
import com.vicente.managerdemo.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 系统角色表 Mapper 接口
 * </p>
 *
 * @author vicente
 * @since 2024-12-04
 */
public interface RoleMapper extends BaseMapper<Role> {

    List<Long> listUserIdsByRoleId(Long roleId);

    int deleteUserRoleByRoleId(@Param("roleId")Long roleId);

    int insertUserRole(@Param("roleId")Long roleId, @Param("userIds")List<Long> userIds);

    List<Menu> listMenusByRoleId(Long roleId);

    Role checkRoleNameUnique(String roleName);

    Role checkRoleKeyUnique(String roleKey);

    void deleteRoleMenuByRoleId(Long roleId);

    void insertRoleMenu(Long roleId, List<Long> menuIds);
}
